***********************************************************************************************
***
***	INTERTEMPORAL EVIDENCE ON THE STRATEGY OF POPULISM IN THE US (Gennaro, Lecce, Morelli)
***	Replication Package
***  
*** Appendix - Table A16
***
***********************************************************************************************



clear
est clear 

* Indicate location of the replication package here
cd "/Replication Package"

cd "/Users/gloria/Dropbox (Personal)/Progetti/Populism US drafts/Replication Package"


**********************************************
* Upload Data                            *****
**********************************************

use "3_data/for_analysis/congress_election_both.dta", clear


merge m:1 state dist_code election_year using "3_data/processed/cses_election_both.dta"
drop if _m==2
drop _m
keep if uncont==0 & indep==0
global controls "female i.age_cat_num i.ethnicity2 i.educ_cat len_words i.election_year"


eststo m1: areg pop_dim2_s i.outsider_correct##i.competitivedistricts##c.econ $controls  if populist==1, a(state) cluster(district)
eststo m2: areg pop_dim2_s i.outsider_correct##i.competitivedistricts##c.econ $controls  if populist==0, a(state) cluster(district)


eststo m3: areg pop_dim2_s i.outsider_correct##i.competitivedistricts##c.econ  pop_attitudes $controls , a(state) cluster(district)
eststo m4: areg pop_dim2_s i.outsider_correct##i.competitivedistricts##c.econ i.outsider_correct##i.competitivedistricts##c.pop_attitudes $controls , a(state) cluster(district)

esttab m1 m2 m3 m4 using "4_results/tables/tabA16.tex", f label replace booktabs alignment(D{.}{.}{-1}) ///
keep(1.outsider_correct 1.competitivedistricts econ 1.outsider_correct#1.competitivedistricts 1.outsider_correct#c.econ 1.competitivedistricts#c.econ  1.outsider_correct#1.competitivedistricts#c.econ 1.outsider_correct#1.competitivedistricts#c.pop_attitudes pop_attitudes) ///
s(N r2, fmt(0 2) label("Observations" "R-squared")) ///
nomtitles star(* 0.10 ** 0.05 *** 0.01) r2 b(3) se(3) brac nonotes
